<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sj" tagdir="/WEB-INF/tags/spring-jquery-tags"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<script type="text/javascript">
	$(document).ready(
			function() {
				$('.edit-cipeproject-link').click(
						function() {
							loadDiv('content',
									'showEditKnowledgeManagement.do?id='
											+ $(this).attr('cipeprojectId'));

						});

				$(".tablesorter").tablesorter().tablesorterPager({
					container : $("#pager")
				});
			});
</script>
<%@ include file="/common/pager.jsp"%>
<table class="tablesorter">
	<c:choose>
		<c:when test="${!empty cipeprojectList}">
			<thead>
				<tr>
					<!--th nowrap>&#10;<input type="checkbox" id="check-all"><spring:message code="common.select.all"/></th -->
					<th><spring:message code="knowledgeManagementlist.table.heading.projectID" /></th>					
					<th><spring:message code="cipeprojectlist.table.heading.projectTitle" /></th>
					<th><spring:message code="knowledgeManagementlist.table.heading.startDate" /></th>
					<th><spring:message code="knowledgeManagementlist.table.heading.endDate" /></th>
					<th><spring:message code="knowledgeManagementlist.table.heading.acronym" /></th>
					<th><spring:message code="knowledgeManagementlist.table.heading.partner" /></th>
					<th><spring:message code="knowledgeManagementlist.table.heading.region" /></th>
					<th><spring:message code="knowledgeManagementlist.table.heading.country" /></th>
					<%--<th><spring:message code="knowledgeManagementlist.table.heading.impact" /></th> --%>
					<th><spring:message code="knowledgeManagementlist.table.heading.status" /></th>
					<th><spring:message code="knowledgeManagementlist.table.heading.organizationtype" /></th>
					<th><spring:message code="knowledgeManagementlist.table.heading.managementFunds" /></th>
					<!--th><spring:message code="knowledgeManagementlist.table.heading.view" /></th-->
					<!--th nowrap><spring:message code="knowledgeManagementlist.table.heading.viewProjectGrant" /></th-->
				</tr>
			</thead>
			<tbody id="paymentRqst">
				<c:forEach items="${cipeprojectList}" var="cipeproject">
					<tr>
						<!--tr> <td><input type="checkbox" name="check_element" value="${cipeproject.id}"></td -->
						<td><a href="javascript://" class="edit-cipeproject-link" cipeprojectId="${cipeproject.id}">${cipeproject.projectID}</a></td>
						<td>${cipeproject.projectTitle}</td>
						<td><fmt:formatDate pattern="MM-dd-yyyy" value="${cipeproject.projectStartDate}" /></td>
						<td><fmt:formatDate pattern="MM-dd-yyyy" value="${cipeproject.projectEndDate}" /></td>
						<td>${cipeproject.acronym}</td>
						<td>${cipeproject.partner.partnerName}</td>
						<td>${cipeproject.region.displayName}</td>
						<td>${cipeproject.country.displayName}</td>
						<%-- <td>${cipeproject.impact.displayName}</td>  --%>
						<td>${cipeproject.cipeprojectstatus.displayName}</td>
						<td>${cipeproject.organizationtype.displayName}</td>
						<td><fmt:formatNumber type="currency" value="${cipeproject.cipeFunds}" pattern="$#,##0;"/></td>
						<%--<c:choose>
										<c:when test="${cipeproject.cipeprojecttype.displayName=='Partner'}">
											<td><spring:message code="label.dollar"></spring:message>${cipeproject.partnerBudgetAmount}</td>
											<!--td><a href="javascript://" class="edit-cipeproject-link" cipeprojectId="${cipeproject.id}"><spring:message code="label.view" /></a></td -->
											<!--td align="center"><a href="javascript://" class="edit-partnergrantview-link" cipeprojectId="${cipeproject.id}"><spring:message code="label.view" /></a></td-->
										</c:when>
										<c:otherwise>
											<td><spring:message code="label.dollar"></spring:message></td> 
											<!--td><a href="javascript://" class="edit-cipeproject-link" cipeprojectId="${cipeproject.id}"><spring:message code="label.view" /></a></td-->
											<!--td align="center"><a href="javascript://" class="edit-cipeprojectsummary-link" cipeprojectId="${cipeproject.id}"><spring:message code="label.view" /></a></td-->
										</c:otherwise>
									</c:choose> --%>
					</tr>
				</c:forEach>
				<!--tr align="center"><td align="left" colspan="12"><input type="button" class="blue_btn" name="view" value="View Knowledge Management Catalogue Results" align="center" tabindex="-1">&nbsp;&nbsp;&nbsp;<input type="button"  class="blue_btn" name="view" value="View Project/Grant Details" align="center" tabindex="-1"></td></tr-->
		</c:when>
		<c:otherwise>
			<c:if test="${ !empty param.action}">
				<tr>
					<td colspan="12">Your query has returned 0 records</td>
				</tr>
			</c:if>
		</c:otherwise>
	</c:choose>
	</tbody>
</table>